package com.qf.controller;

import com.qf.vo.R;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ASUS
 * @version V1.0
 * @Project work
 * @Package com.qf.controller
 * @Date 2021/10/13 10:44
 */
@RestController
public class TaskController {
    
    @Resource
    private Scheduler scheduler;

    @GetMapping("/task/stop")
    public R stop() throws SchedulerException {
        //暂停所有
        scheduler.pauseAll();
        return R.ok();
    }
    @GetMapping("/task/start")
    public R start() throws SchedulerException {
        //恢复所有
        scheduler.resumeAll();
        return R.ok();
    }


}
